Page({
    data: {
        // 定义轮播图图片资源
        img:[
            '../imgs/b1.jpg',
            '../imgs/b2.jpg',
            '../imgs/b3.jpg',
            '../imgs/b4.jpg',
            '../imgs/b5.jpg'
        ],
        list1:[],
        id:0,
        Page:0,
        isshow:true
    },
    onLoad(optios){
        setTimeout(() => {
            this.setData({
                isshow:false
            })
        }, 2000);
        wx.setNavigationBarTitle({
          title: optios.name,
        })
        console.log(optios);
        wx.request({
            url: 'https://route.showapi.com/1700-2?showapi_appid=1367085&showapi_sign=cb8507c33e4a43cfa34a954c91b91fd6',
            method: "GET",
            data: {classifyId:optios.id},
            Header: { "content-type": "application/json" },
            success: (res) => {
                console.log(res);
                this.setData({
                  list1:res.data.showapi_res_body.contentlist

                })
            },
            fail: (err) => {
                console.log(err);
            }


        })
    },
    onReachBottom(){
        this.Page++
    console.log(123);
    },
    onReady(){
        console.log(this.data.list1);
    },
    tiao(e){
        console.log(e.currentTarget.dataset.index);
        let index = e.currentTarget.dataset.index
        let data1 = this.data.list1[index]
        console.log(data1);
        wx.navigateTo({
          url:`../detail/detail?id=${data1.id}&title=${data1.title}&classifyId=${data1.classifyId}`,
        })


    }


   
})